package com.lighthouse.doc.search.service.impl;

import java.util.List;

import com.lighthouse.doc.search.domain.KnowledgeDocSearch;
import com.lighthouse.doc.search.mapper.KnowledgeDocSearchMapper;
import com.lighthouse.doc.search.service.IKnowledgeDocSearchService;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * searchService业务层处理
 * 
 * @author ysz
 * @date 2023-08-15
 */
@Service
public class KnowledgeDocSearchServiceImpl implements IKnowledgeDocSearchService
{
    @Autowired
    private KnowledgeDocSearchMapper knowledgeDocSearchMapper;

    /**
     * 查询search
     * 
     * @param userId search主键
     * @return search
     */
    @Override
    public KnowledgeDocSearch selectKnowledgeDocSearchByUserId(Long userId)
    {
        return knowledgeDocSearchMapper.selectKnowledgeDocSearchByUserId(userId);
    }

    /**
     * 查询search列表
     * 
     * @param knowledgeDocSearch search
     * @return search
     */
    @Override
    public List<KnowledgeDocSearch> selectKnowledgeDocSearchList(KnowledgeDocSearch knowledgeDocSearch)
    {
        return knowledgeDocSearchMapper.selectKnowledgeDocSearchList(knowledgeDocSearch);
    }

    /**
     * 查询search列表
     *
     * @param knowledgeDocSearch search
     * @return search集合
     */
    @Override
    public List<KnowledgeDocSearch> selectKnowledgeDocSearchListHistory(KnowledgeDocSearch knowledgeDocSearch) {
        knowledgeDocSearch.setUserId(SecurityUtils.getUserId());
        return knowledgeDocSearchMapper.selectKnowledgeDocSearchListHistory(knowledgeDocSearch);
    }

    /**
     * 查询search列表
     *
     * @param knowledgeDocSearch search
     * @return search集合
     */
    @Override
    public List<KnowledgeDocSearch> selectKnowledgeDocSearchListHot(KnowledgeDocSearch knowledgeDocSearch) {
        return knowledgeDocSearchMapper.selectKnowledgeDocSearchListHot(knowledgeDocSearch);
    }

    /**
     * 新增search
     * 
     * @param knowledgeDocSearch search
     * @return 结果
     */
    @Override
    public int insertKnowledgeDocSearch(KnowledgeDocSearch knowledgeDocSearch)
    {
        return knowledgeDocSearchMapper.insertKnowledgeDocSearch(knowledgeDocSearch);
    }

    /**
     * 修改search
     * 
     * @param knowledgeDocSearch search
     * @return 结果
     */
    @Override
    public int updateKnowledgeDocSearch(KnowledgeDocSearch knowledgeDocSearch)
    {
        return knowledgeDocSearchMapper.updateKnowledgeDocSearch(knowledgeDocSearch);
    }

    /**
     * 批量删除search
     * 
     * @param userIds 需要删除的search主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeDocSearchByUserIds(Long[] userIds)
    {
        return knowledgeDocSearchMapper.deleteKnowledgeDocSearchByUserIds(userIds);
    }

    /**
     * 删除search信息
     * 
     * @param userId search主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeDocSearchByUserId(Long userId)
    {
        return knowledgeDocSearchMapper.deleteKnowledgeDocSearchByUserId(userId);
    }
}
